package com.cn.http.impl;


import com.cn.enums.HttpMethodEnum;
import lombok.Getter;
import lombok.Setter;

import java.net.URL;
import java.util.HashMap;
import java.util.Map;

/**
 * &#064;Time 2024 八月 星期五 15:32
 *
 * @author ShangGuan
 */
@Setter
@Getter
public class Http {


    private URL url;

    private HttpMethodEnum method;

    private Map<String, String> headers = new HashMap<>();


    public Http(URL url) {
        this.url = url;
    }

    public Http(URL url, HttpMethodEnum method, Map<String, String> headers) {
        this.url = url;
        this.method = method;
        this.headers = headers;
    }

    public Http addRequestHeader(String key, String value) {
        this.headers.put(key, value);
        return this;
    }


}
